<template>
  <div id="lesson-face-page">
    <div class="lesson-info">
      <!-- 顶部主要信息简介开始 -->
      <div class="top">
        <el-breadcrumb
          style="padding: 15px"
          separator-class="el-icon-arrow-right"
        >
          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item>课程详情</el-breadcrumb-item>
        </el-breadcrumb>

        <div class="video">
          <div class="left-video-face">
            <img
              src="https://t7.baidu.com/it/u=3601447414,1764260638&fm=193&f=GIF"
              alt=""
            />
            <span class="play" @click="joinLesson"><i class="el-icon-caret-right"></i>播放</span>
          </div>
          <div class="right-video-info">
            <div class="title-share">
              <div class="name">
                <div class="label">平台严选</div>
                <div class="lesson-name">Python基础</div>
              </div>
              <div class="share">
                <span>分享</span>
                <span>
                  <i class="el-icon-s-promotion"></i>
                </span>
                <span>
                  <i class="el-icon-s-opportunity"></i>
                </span>
              </div>
            </div>
            <div class="lesson-num">本课19课时</div>
            <div class="lesson-start">
              <span>创建时间：2022-2-23 10:23:23</span>
            </div>
            <div class="finish">
              <span
                >课程进度：<el-switch
                  active-text="已完成"
                  :value="true"
                  disabled
                >
                </el-switch
              ></span>
            </div>
            <div class="lesson-classmate">
              <div class="left">
                当前评分：
                <el-rate
                  v-model="lessonScore"
                  disabled
                  show-score
                  text-color="#ff9900"
                  score-template="3.7"
                >
                </el-rate>
              </div>
              <div class="right">123人观看</div>
            </div>
            <div class="tags">
              <el-tag>标签一</el-tag>
              <el-tag type="success">标签二</el-tag>
              <el-tag type="info">标签三</el-tag>
              <el-tag type="warning">标签四</el-tag>
              <el-tag type="danger">标签五</el-tag>
            </div>
            <div class="join-now-btn">
              <el-button type="primary" @click="joinLesson" round>立即参加</el-button>
            </div>
          </div>
        </div>
      </div>
      <!-- 顶部主要信息简介结束 -->

      <!-- 下部内容介绍开始 -->
      <div class="bottom">
        <!-- 左侧课程内容开始 -->
        <div class="lesson">
          <el-menu
            :default-active="activeIndex"
            active-text-color="#409EFF"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
          >
            <el-menu-item index="lessonInfo">课程信息</el-menu-item>
            <el-menu-item index="lessonComment">课程评价</el-menu-item>
          </el-menu>

          <!-- 课程信息开始 -->
          <div v-if="activeIndex == 'lessonInfo'" class="lesson-info">
            <lesson-info />
          </div>
          <!-- 课程信息结束 -->

          <!-- 课程评价开始 -->
          <div v-else class="lesson-comment">
            <lesson-comment />
          </div>
          <!-- 课程评价结束 -->
        </div>
        <!-- 左侧课程内容结束 -->
        <!-- 右侧作者和推荐开始 -->
        <div class="author-recommend">
          <div class="author">
            <author-board />

          </div>
          <div class="recommend">
            <recommend-board />
          </div>
        </div>
        <!-- 右侧作者和推荐结束 -->
      </div>
      <!-- 下部内容介绍结束 -->
    </div>
  </div>
</template>

<script>
import AuthorBoard from "../../components/board/AuthorBoard.vue";
import LessonBoardItem from "../../components/board/LessonBoardItem.vue";
import RecommendBoard from "../../components/board/RecommendBoard.vue";
import LessonComment from "../../components/lessons/LessonComment.vue";
import LessonInfo from "../../components/lessons/LessonInfo.vue";
export default {
  components: {
    LessonInfo,
    LessonComment,
    AuthorBoard,
    RecommendBoard,
    LessonBoardItem,
  },
  data() {
    return {
      lessonScore: 3.7,
      activeIndex: "lessonInfo",
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      this.activeIndex = key;
    },
    joinLesson(){
      this.$router.push("/video")
    }
  },
};
</script>

<style scoped>
#lesson-face-page {
  background: linear-gradient(#40a0ff5d, #f5f5f5aa);
}

#lesson-face-page .lesson-info{
  width: 100%;
  height: 100%;
  padding-top: 30px;
}

#lesson-face-page .lesson-info .top {
  width: 85%;
  margin: 0 auto;
  border-radius: 10px;
  background-color: white;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.2);
}

#lesson-face-page .lesson-info .top .video {
  display: flex;
  display: -webkit-flex;
  justify-content: start;
  padding: 15px;
}

#lesson-face-page .lesson-info .top .video .left-video-face {
  width: 45%;
  height: 300px;
}

#lesson-face-page .lesson-info .top .video .left-video-face .play {
  position: absolute;
  left: 22%;
  top: 33%;
  font-size: 20px;
  line-height: 40px;
  padding: 0 20px;
  background-color: white;
  color: black;
  border-radius: 20px;
  cursor: pointer;
}

#lesson-face-page .lesson-info .top .video .left-video-face .play:hover {
  background-color: #ffffffaa;
}

#lesson-face-page .lesson-info .top .video .right-video-info {
  width: 55%;
  margin-left: 20px;
}

#lesson-face-page .lesson-info .top .video .left-video-face img {
  width: 100%;
  height: 300px;
  border-radius: 10px;
}

#lesson-face-page .lesson-info .top .video .right-video-info .title-share {
  width: 100%;
  display: flex;
  display: -webkit-flex;
  justify-content: space-between;
}

#lesson-face-page
  .lesson-info
  .top
  .video
  .right-video-info
  .title-share
  .name {
  display: flex;
  display: -webkit-flex;
  justify-content: start;
}
#lesson-face-page
  .lesson-info
  .top
  .video
  .right-video-info
  .title-share
  .name
  .label {
  font-size: 14px;
  line-height: 20px;
  padding: 0 7px;
  border: 1px solid #cba265;
  color: #cba265;
  border-radius: 3px;
}

#lesson-face-page
  .lesson-info
  .top
  .video
  .right-video-info
  .title-share
  .name
  .lesson-name {
  font-size: 20px;
  line-height: 20px;
  padding: 0 7px;
  font-weight: bold;
}

#lesson-face-page .lesson-info .top .video .right-video-info .lesson-num {
  font-size: 14px;
  line-height: 28px;
  margin-top: 10px;
  margin-bottom: 10px;
}

#lesson-face-page .lesson-info .top .video .right-video-info .lesson-start,
.finish {
  font-size: 14px;
  line-height: 18px;
  color: gray;
}

#lesson-face-page .lesson-info .top .video .right-video-info .lesson-classmate {
  color: gray;
  font-size: 12px;
  display: flex;
  display: -webkit-flex;
  justify-content: space-between;
  margin: 10px 0;
}
#lesson-face-page
  .lesson-info
  .top
  .video
  .right-video-info
  .lesson-classmate
  .left {
  display: flex;
  display: -webkit-flex;
  justify-content: start;
  align-items: center;
}

#lesson-face-page .lesson-info .top .video .right-video-info .tags {
  margin: 20px 0;
}

#lesson-face-page .lesson-info .bottom {
  width: 85%;
  margin: 30px auto;
  background-color: transparent;
  display: flex;
  display: -webkit-flex;
  justify-content: space-between;
}

#lesson-face-page .lesson-info .bottom .lesson {
  width: 70%;
  background-color: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.2);
  margin-bottom: 100px;
}

#lesson-face-page .lesson-info .bottom .author-recommend {
  width: 23%;
  background-color: transparent;
  margin-bottom: 100px;
}
#lesson-face-page .lesson-info .bottom .author-recommend .recommend {
  margin-top: 40px;
  width: 100%;
  background-color: #fff;
  border-radius: 10px;
  padding: 15px 0;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.2);
}
#lesson-face-page .lesson-info .bottom .author-recommend .author {
  width: 100%;
  background-color: #fff;
  border-radius: 10px;
  padding: 15px 0;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.2);
}
</style>